const router = new require("@koa/router")({ prefix: "/dynamic" });
const { auth } = require("../middleware/auth")
const {
  add_dynamic,
  get_new_dynamic_num,
  get_friends_dynamic,
  get_dynamic,
  update_dynamics_read_status
} = require("../controller/dynamic_controller");
const {
  add_dynamic_validator,
  get_new_dynamic_num_validator,
  get_friends_dynamic_validator,
  get_dynamic_validator,
  update_dynamics_read_status_validator
} = require("../validate/dynamic_validator");

/**
 * 添加动态
 */
router.post("/add_dynamic", add_dynamic_validator, add_dynamic);

/**
 * 获取登录用户的好友新发布的动态人数
 */
router.get("/get_new_dynamic_num", get_new_dynamic_num_validator, get_new_dynamic_num);

/**
 * 获取登录用户所有用户发布的空间动态
 */
router.get("/get_friends_dynamic", get_friends_dynamic_validator, get_friends_dynamic);

/**
 * 根据用户ID获取某个用户的空间动态
 */
router.get("/get_dynamic", get_dynamic_validator, get_dynamic);


router.put("/update_dynamics_read_status", update_dynamics_read_status_validator, update_dynamics_read_status);

module.exports = router;
